<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>验证码验证</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/static/H/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/H/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/static/H/css/animate.css" rel="stylesheet">
    <link href="/static/H/css/style.css?v=4.1.0" rel="stylesheet">

    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

        <div id="tab-1" class="tab-pane active">
            <div class="middle-box text-center loginscreen  animated fadeInDown">
                <h3>输入验证码</h3>
                <div class="form-group">
                    <form action="{:url('admin/sign/compare')}" method="post">
                        <input type="text" name = 'yzm' class="form-control" autocomplete="off" placeholder="请输入验证码" required="">
                        <button type="button" id="send" class="btn btn-primary block full-width m-b">获取验证码</button>
                        <button type="submit" class="btn btn-primary block full-width m-b">下一步</button>
                    </form>
                </div>
            </div>
        </div>

<!-- 全局js -->
<script src="/static/H/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/H/js/bootstrap.min.js?v=3.3.6"></script>
<script type="text/javascript" src="/static/ui/lib/layer/3.1/layer.js"></script>


<script>

//获取验证码按钮,点击时候更改属性设置定时任务
$('#send').click(function () {
    $.post('{:url("admin/Sign/faSong")}', function (e) {
        console.log(e);
            if (e.code){
                $('#send').html('<span id="second">60</span>秒后重新发送');
                timer = setInterval(f,1000);
                $('#send').attr('disabled','disabled');
                // layer.alert(e.info);
            }else {
                alert(e.info)
            }
        })
    });

    function f() {
        var t = $('#second').html();
        if (t == 0) {
            clearInterval(timer);
            $('#send').html('重新获取验证码').attr('disabled', false);
        } else {
            $('#second').html(t - 1);
        }
    // }
}


</script>


</body>

</html>